﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.master" AutoEventWireup="true" CodeFile="Hienthitintuc.aspx.cs" Inherits="admin_Hienthitintuc" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<script type="text/javascript">
    function isconfirm() {
        var ck = confirm('Bạn có chắc xoá hay không?');
        if (ck == true)
            return true;
        else
            return false;
    }

        </script>


    <form id="form1" runat="server">
    <table style="width:100%;">
        <tr>
            <td>
            <table border="1" width="600">
            
          
                <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" 
                    onitemcommand="Repeater1_ItemCommand">
                <HeaderTemplate>
                <tr>
                            <th align="center">Mã Tin Tức</th>
							<th align="center">Tiêu Đề</th>
							<th align="center">Mô Tả</th>
							<th align="center">Chi Tiết</th>
							<th align="center">Ngày Đăng</th>
							<th align="center">Hình Ảnh</th>					
                            <th align="center">Xoá</th>			
                             <th align="center">Sửa</th>	
                </tr>
                
                </HeaderTemplate>
                <ItemTemplate>
                <tr>
                            <td align=center><asp:HyperLink ID="hplMaTT" runat="server" NavigateUrl='<%# "~/ThemTinTuc.aspx?matintuc=" + DataBinder.Eval(Container.DataItem,"matintuc")%>' Text='<%# DataBinder.Eval(Container.DataItem,"matintuc")%>' /></td>
							<td align=center><%#Eval("tieude")%></td>
							<td align=center><%#Eval("mota")%></td>
							<td align=center><%#Eval("chitiet")%></td>
							<td align=center><%#Eval("ngaydang")%></td>
							<td align=center><%#Eval("hinhanh")%></td>
							<td align=center><asp:ImageButton ID="imagebtxoa" runat="server" CommandArgument='dk' CommandName="Xoa" OnClientClick='return isconfirm()'
            ImageUrl="images/action_remove.png" /><a href="SuaTinTuc.aspx?matintuc=<%#Eval("matintuc")%>"></a></td>
                            <td> <a href="Suatintuc.aspx?matintuc=<%#Eval("matintuc") %>"><img src="images/action_check.png" alt="Check" /></a></td>
                
                </tr>
                
                
                </ItemTemplate>
                </asp:Repeater>
                  </table>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:maytinhxachtayConnectionString %>" 
                    SelectCommand="SELECT [MaTinTuc], [TieuDe], [MoTa], [ChiTiet], [Ngaydang], [HinhAnh] FROM [TinTuc]">
                </asp:SqlDataSource>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        </table>
    </form>
</asp:Content>

